<template>
 <div class="nonce" style="display: none">
   {{forms}}{{nodes}}
 </div>
</template>

<script>
/**
 * @author 'yejinbo'
 * @description `这是用来统计现在有多少表单，表单中有多少组件的一个隐藏组件`
 */
import * as types from '../../store/types'
export default {
  computed: {
    forms () {
      if (!this.formlist || !(this.formlist.length > 0)) return ''
      let _forms = []
      for (let v of this.formlist.entries()) {
        let obj = {
          label: v.title,
          value: v.business
        }
        _forms.push(obj)
      }
      this.$store.dispatch(types.ALLFORMS, _forms)
      return _forms
    },
    formID () {
      return this.formID
    },
    nodes () {
      if (!this.nodelist || !(this.nodelist.length > 0)) return ''
      let _n = []
      for (let v of this.nodelist) {
        if (typeof v === 'object') {
          let obj = {
            label: v.mine.describe,
            value: v.mine.business,
            children: []
          }
          // for (let vi of v.items) {
          //   let o = {
          //     label: vi.
          //   }
          // }
          _n.push(obj)
        }
      }
      return ''
    }
  },
  components: {},
  props: {
    formid: {
      type: String
    },
    formlist: {
      type: Array
    },
    nodelist: {
      type: Array
    },
    indexTap: {
      type: String
    }
  }
}
</script>
